<script setup lang="ts">
import { ref, onMounted } from 'vue'
import HeaderCom from './components/header/index.vue'
import TouristCom from './components/tourist/index.vue'
import AgeCom from './components/age/index.vue'
import GenderCom from './components/gender/index.vue'
const screenRef = ref()
onMounted(() => {
  screenRef.value.style.transform = `scale(${getScale()}) translate(-50%, -50%)`
})
const getScale = (w = 1920, h = 1080) => {
  const ww = window.innerWidth / w
  const wh = window.innerHeight / h
  return ww < wh ? ww : wh
}

window.onresize = () => {
  screenRef.value.style.transform = `scale(${getScale()}) translate(-50%, -50%)`
}
</script>

<template>
  <div class="container">
    <div class="screen" ref="screenRef">
      <HeaderCom></HeaderCom>
      <el-row>
        <el-col :span="5" class="left">
          <TouristCom></TouristCom>
          <GenderCom></GenderCom>
          <AgeCom></AgeCom>
        </el-col>
        <el-col :span="12" :offset="1"></el-col>
        <el-col :span="5"></el-col>
      </el-row>
    </div>
  </div>
</template>

<style scoped lang="scss">
.container {
  width: 100vw;
  height: 100vh;
  background: url('./images//bg.png') no-repeat;
  .screen {
    position: fixed;
    width: 1920px;
    height: 1080px;
    left: 50%;
    top: 50%;
    transform-origin: left top;
  }
}
.left {
  height: 1080px;
  display: flex;
  flex-direction: column;
}
</style>
